<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>
<body>
    运行结果<div id="result"></div>
    <script>
        //对1-100进行遍历
        for(i=1;i<=100;i++){
            //判断i是否是素数
            for(j=2;j<i;j++){
             if(i%j===0)break;
            }
            //判断i是否是素数
            if(j===i){
                console.log(i,"是素数")
            }
        }

        //1.定义三个变量
        var red,white,black;
        //white=25-red;
        for(red=0;red<=25;red++){
            for(white=0;white<=31;white++){
                for(black=0;black<=28;black++){
                    //判断 
                    if(red+white===25
                    && white+black===31
                    && red+black===28){
                        //输出
                        console.log(red,white,black)
                    }
                }
            }
        }
        //定义三个变量
        var red,white,black;
        for(red=0;red<=25;red++){
            for(black=0;black<=28;black++){
                white=25-red;
                //判断
                if(white+black===31
                && red+black===28){
                    //输出
                    console.log(red,white,black)
                }
            }
        }
         //定义三个变量
        var red,white,black;
        for(red=0;red<=25;red++){
                white=25-red;
                black=31-white;
                //判断
                if(red+black===28){
                    //输出
                    document.getElementById("result").innerText="red="+red+",white="+white+",black="+black;
                    console.log(red,white,black)
                }
            }
            
    </script>
</body>
</html>